package com.sqfw.common.enums.knowledge;

import lombok.Getter;

/**
 * '0 提交待审核, 3 待处理, 5 办结待审核, -1 已归档, -2 提交审核退回, -3 办结审核退回 （原备注 0：发起；1值班长审核；2管理办公室审核；-1已归档）'
 * */
public enum KlHasStatusEnum {

    SUBMIT_FOR_REVIEW("0", "提交待审核"),
    PENDING_PROCESSING("3", "待处理"),
    COMPLETED_FOR_REVIEW("5", "办结待审核"),
    ARCHIVED("-1", "已归档"),
    SUBMIT_FOR_REVIEW_AND_RETURN("-2", "提交审核退回"),
    COMPLETED_REVIEW_RETURN("-3", "办结审核退回")
    ;

    @Getter
    private String key;
    @Getter
    private String desc;

    KlHasStatusEnum(String key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    /**
     * 根据key，查询描述
     * */
    public static KlHasStatusEnum by(String key) {
        KlHasStatusEnum[] enums = KlHasStatusEnum.values();
        for (int i = 0; i < enums.length; i++) {
            if (key.equals(enums[i].key) ) {
                return enums[i];
            }
        }
        return null;
    }

}
